Skip to content

Release - #44

Merged
slesaad merged 5 commits into
masterfrom
staging
Jul 28, 2026
Merged

Release#44
slesaad merged 5 commits into
masterfrom
staging

Conversation

@slesaad

@slesaad slesaad commented Jul 28, 2026

Copy link
Copy Markdown
Member

Changelog

#43
#42

slesaad added 5 commits July 23, 2026 14:42
The unauthenticated POST /validate endpoint passed a client-controlled
filename directly into os.path.join(TMP_DIR, filename). Because
os.path.join discards the base when the second argument is absolute, and
no traversal/separator checks existed, a caller could write uploaded
content to arbitrary locations in the Lambda's writable area (/tmp),
poisoning the shared pyQuARC cache (CACHE_DIR=/tmp) or filling the disk.

Changes:
- Add safe_upload_path(): keep only a sanitized basename of the client
  filename and write into a fresh per-request /tmp/uploads/<uuid>/
  directory, with a post-resolution containment check. Neutralizes
  absolute paths, ../ traversal, nested paths, and cross-request
  collisions in warm containers. Also fixes a crash when filename is
  omitted (path.join(TMP_DIR, None) -> TypeError).
- Move wrap_inputs() inside try/finally so the per-request AUTH_TOKEN env
  var is always cleared and uploads are always removed, preventing token
  leakage into a subsequent request in a warm container.
- Stop echoing auth_key and raw file content back in the response params.
- Return only the uploaded file's basename in results, never the server
  path.
- Throttle the public API stage (rate 20/burst 40) as defense in depth.

CWE-22, CWE-73.
The runners dropped Python 3.8, so the lint workflow failed with
"Version 3.8 with arch x64 not found", and the older action majors run
on the now-deprecated Node 20.

- lint.yml: setup-python@v1 (3.8) -> @v6 (3.9), matching the Lambda
  runtime and the deploy workflows; checkout@v2 -> @v5;
  wearerequired/lint-action@v1 -> @v2.
- deploy.yml / update_pyquarc.yml: checkout@v2 -> @v5,
  configure-aws-credentials@v1 -> @v4, setup-python@v2 -> @v6.
- deploy.yml: setup-node@v2 -> @v5 and bump the CDK build Node from the
  EOL 14.15.1 to 20 LTS.
The lint workflow flagged pre-existing issues in the deploy package:

- flake8 F401: remove unused DockerImage import in stack.py.
- black: reformat the BundlingOptions command list onto separate lines
  and drop the extra blank line in app.py.

All 8 tracked Python files now pass `black --check --line-length 100`
and `flake8`.
…ation

Update GitHub Actions to Node 24 majors and Python 3.9
…dp2966

Fix arbitrary file write in /validate endpoint (VDP-2966)
@slesaad
slesaad requested a review from xhagrg July 28, 2026 18:53
@slesaad
slesaad merged commit c0a1330 into master Jul 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants